﻿using System;
using System.Windows;

namespace AdTech.Snap
{
    /// <summary>
    /// Defines an interface for a drawable rectangle.
    /// </summary>
    public interface IDrawableRectangle
    {
        // Properties
        /// <summary>
        /// Gets a value whether the rectangle is currently being drawn.
        /// </summary>
        bool IsDrawing { get; }

        // Methods
        /// <summary>
        /// Initiates drawing.
        /// </summary>
        /// <param name="startPosition">The point the rectangle is drawn from.</param>
        void StartDrawing(Point startPosition);

        /// <summary>
        /// Extends the rectangle to be drawn to the given point.
        /// </summary>
        /// <param name="absoluteCurrentPosition">The current position.</param>
        void Draw(Point absoluteCurrentPosition);

        /// <summary>
        /// Finishes drawing.
        /// </summary>
        void FinishDrawing();

        /// <summary>
        /// Gets the drawn rectangle relative to the client.
        /// </summary>
        /// <returns>The rectangle relative to the client.</returns>
        Rect GetDrawedRectangle();

        /// <summary>
        /// Gets the drawn rectangle relative to screen.
        /// </summary>
        /// <param name="relativeToScreen">The handle of a window.</param>
        /// <returns>The rectangle relative to screen.</returns>
        Rect GetDrawedRectangle(IntPtr relativeToScreen);
    }
}
